<?php
include_once('../lib/config.php');
include_once('../lib/function.php');

$opts = getopt('', ['min:', 'max:']);
if(!$opts['min'] || !$opts['max']) {
    echo2('--min --max required', 'QISUU_VIEW');
    sleep(5);
    exit;
}

$url_tpl = 'http://www.lnsuu.com/forum.php?mod=viewthread&tid=%s';

while (true) {
    $tid = mt_rand($opts['min'], $opts['max']);
    $url = sprintf($url_tpl, $tid);

    $c = mt_rand(5,30);
    echo2($url . " C:$c" . "\n", 'QISUU_VIEW');

    while($c--) {
        $shell  = "curl -s '{$url}'";
        $result = shell_exec($shell);
    }
}